For Loop with If Statement in Google Sheets